package com.gulangyu.trade.mvc;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import com.gulangyu.trade.ws.NeedLogin;
import com.mycompany.yourtrade.common.SmsClient;
import com.mycompany.yourtrade.model.IndexListLoan;

import com.mycompany.yourtrade.service.PnrService;
import java.io.IOException;
import java.util.List;
import javax.ws.rs.core.MediaType;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@NeedLogin
@Controller
@RequestMapping(value = "loan")
public class LoanController {

    @Autowired
    private PnrService pnrService;

    @Autowired
    private SmsClient smaClient;

    @RequestMapping(value = "indexLoans", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON)
    @ResponseBody
    public List<IndexListLoan> index(String length) throws IOException {
        List<IndexListLoan> list = this.pnrService.getIndexListLoan();        
        return list;
    }
    
}
